<!DOCTYPE html>
<html lang="zh">
<head>
    <title>操作日志 - 派后台管理系统</title>
    {include file="public/header" /}
</head>
<body>
<div class="container-fluid p-t-15">
    <div class="row">
        <div class="col-lg-12">
            <div class="card">
                <div class="card-header"><h4>{$name}</h4></div>
                <div class="card-body">
                    
                    <form action="" class="form-inline">
                        <i class="fa fa-search" style="margin-right: 10px;"></i>
                        <input type="hidden" name="gid" value="{$where.gid}">
                        <select name="status" aria-controls="editable" class="form-control input-sm">
                            <option value="">是否可用</option>
                            <option value="1" {eq name="where.status" value="1"}selected="selected"{/eq}>显示</option>
                            <option value="2" {eq name="where.status" value="2"}selected="selected"{/eq}>不显示</option>
                        </select>
                        <button type="submit" class="btn btn-success" id="search"> 搜索</button> </span>
                    </form>
                </div>
            </div>
        </div>
        <div class="col-lg-12">
            <div class="card">
                <div class="card-toolbar clearfix">
                    <div class="toolbar-btn-action">
                    <button id="btn_add" type="button" class="btn btn-primary m-r-5" onclick="iframe.createIframe('添加数据','/admin/system.SystemGroupData/create?gid={$gid}')">
                        <span class="mdi mdi-plus" aria-hidden="true"></span>新增
                    </button>
                    </div>
                </div>
                <div class="card-body">
                    <div class="table-responsive">
                        <table class="table table-bordered">
                            <thead>
                            <tr>
                                <th class="text-center">编号</th>
                                {volist name="fields" id="vo"}
                                <th class="text-center">{$vo.name}</th>
                                {/volist}
                                <th class="text-center">是否可用</th>
                                <th class="text-center">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {volist name="list" id="vo"}
                            <tr>
                            <td class="text-center">
                                {$vo.id}
                            </td>
                            {volist name="fields" id="item"}
                                <td class="text-center">
                                    {if condition="isset($vo['value'][$item['title']]['value']) && $vo['value'][$item['title']]['value'] !== ''"}
                                        {if condition="$vo.value[$item['title']]['type'] == 'upload' || $vo.value[$item['title']]['type'] == 'uploads'"}
                                          {if condition="is_array($vo.value[$item['title']]['value'])"}
                                            {volist name="vo.value[$item['title']]['value']" id="valueItem"}
                                               <img class="image" data-image="{$valueItem}" width="45" height="45" src="{$valueItem}" />
                                            {/volist}
                                          {else/}
                                            <img class="image" data-image="{$vo.value[$item['title']]['value']}" width="45" height="45" src="{$vo.value[$item['title']]['value']}" />
                                          {/if}
                                        {else/}
                                         {$vo.value[$item['title']]['value']}
                                        {/if}
                                    {/if}
                                </td>
                            {/volist}
                            <td class="text-center">
                                {if condition="$vo.status eq 1"}
                                <i class="mdi mdi-check mdi-24px mdi-red"></i>
                                {elseif condition="$vo.status eq 2"/}
                                <i class="mdi mdi-window-close mdi-24px mdi-red"></i>
                                {/if}
                            </td>
                            <td class="text-center">
                                <button id="btn_add" type="button" class="btn btn-primary m-r-15" onclick="iframe.createIframe('修改数据','/admin/system.SystemGroupData/edit?gid={$gid}&id={$vo['id']}')">
                                    <span class="mdi mdi-lead-pencil" aria-hidden="true"></span>修改
                                </button>
                                <button id="btn_delete" type="button" class="btn btn-danger" onclick="del({$vo['id']})">
                                    <span class="mdi mdi-window-close" aria-hidden="true"></span>删除
                                </button>
                            </td>
                        </tr>
                        {/volist}
                            </tbody>
                        </table>
                    </div>
                    {$list|raw}
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script type="text/javascript">
    
    function del( checkID ) {
        $.confirm({
            title: '重要提醒!',
            content: '选中项删除后将不可恢复，请谨慎操作!',
            backgroundDismiss: true,
            buttons: {
                ok: {
                    text: '确认',
                    btnClass: 'btn-danger',
                    action: function () {
                        $.post("/admin/system.SystemGroupData/del",data={id:checkID},function (res) {
                            if (res.status == 200) { lightyear.notify(res.msg, 'success', 3000, 'mdi mdi-emoticon-happy', 'top', 'center');location.reload();}
                            else lightyear.notify(res.msg, 'delete', 3000, 'mdi mdi-emoticon-neutral', 'top', 'center');
                        })
                    }
                },
                cancel: {
                    text: '取消',
                    btnClass: 'btn-primary'
                }
            }
        });
    }
</script>
</body>
</html>